package juice.DI$multiInterface.module;

import juice.DI$multiInterface.annotation.Home;
import juice.DI$multiInterface.annotation.School;
import juice.DI$multiInterface.service.Service;
import juice.DI$multiInterface.service.impl.HomeService;
import juice.DI$multiInterface.service.impl.SchoolService;

import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Module;

/**
 * 静态注入
 * 
 * @author Beanstao@gmail.com
 * @date 2013-9-23
 * @version 1.0
 */
public class ServiceModule2Static implements Module
{
	@Inject
	@Home
	public static Service homeService;

	@Inject
	@School
	public static Service schoolsService;

	@Override
	public void configure(Binder arg0)
	{
		arg0.bind(Service.class).annotatedWith(Home.class).to(HomeService.class);
		arg0.bind(Service.class).annotatedWith(School.class).to(SchoolService.class);
		// 静态注入
		arg0.requestStaticInjection(ServiceModule2Static.class);
	}

}
